const state = {
    id: "", //当前选中的文件id
    oldId: "", // 上一份选中的文件id
    picIndex: 0, //当前文件图片的索引值，pdf有多张图片
    fileIndex: null, //当前文件在文件列表中的索引值
    pdfItem: {}, //pdf当前页面
    activePosition: { //高亮部分位置
    },
    item: {},

    pdfChildInfo: {
        index: 0, // 当前页
        list: [], // 整体list
    }, // 当前打开的大文件pdf各页信息

    copyResultText: "", // 复制当前页内容

    searchKeyWord: "", // 当前搜索的关键词
    searchKeyNo: 1, // 当前搜索的关键页
    searchKeyFresh: false, // 刷新当前页
    shadowGrayData: null, // web截图临时存储的数据
}

const getters = {}

const actions = {}

const mutations = {
    setFileID(state, fileID) {
        state.id = fileID;
    },
    setFileOldID(state, oldId) {
        state.oldId = oldId;
    },
    setPicIndex(state, picIndex) {
        state.picIndex = picIndex;
    },
    setActivePosition(state, activePosition) {
        state.activePosition = activePosition;
    },
    setItem(state, item) {
        state.item = item;
    },
    setFileIndex(state, fileIndex) {
        state.fileIndex = fileIndex;
    },
    setPdfItem(state, pdfItem) {
        state.pdfItem = pdfItem;
    },
    setPdfChildInfo(state, pdfChildInfo) {
        state.pdfChildInfo = pdfChildInfo;
    },
    setCopyResultText(state, copyResultText) {
        state.copyResultText = copyResultText;
    },
    setSearchKeyWord(state, searchKeyWord) {
        state.searchKeyWord = searchKeyWord;
    },
    setSearchKeyNo(state, searchKeyNo) {
        state.searchKeyNo = searchKeyNo;
    },
    setSearchKeyFresh(state, searchKeyFresh) {
        state.searchKeyFresh = searchKeyFresh;
    },
    setShadowGrayData(state, shadowGrayData) {
      state.shadowGrayData = shadowGrayData;
    },
}

export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations
}
